package logger;

import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * @version 1.0
 * @author:罗苏琴
 * @Date 2024/12/11 下午4:57
 */
public class LogTest {
    public static void main(String[] args) {
    LogService logService=new LogServiceImpl();
    LogService proxyInstance=(LogService) Proxy.newProxyInstance(
            logService.getClass().getClassLoader(),
            logService.getClass().getInterfaces(),
            new LoggingInvocationHandler(logService)
    );
    proxyInstance.testMethod1();
    proxyInstance.testMethod2();
    proxyInstance.testMethod3();
    }
}